#ifndef BUCKET_H_
#define BUCKET_H_
#include "../Record.h"
#include <string>
#include <sstream>

enum estados {ok, full, empty, noaction};

class Bucket {
private:
	int dispersionSize;
	int bucketSize;
    int freeBytes;
	vector<Record*>* records;
	vector<Record*>* getRecordsFromBlock(char* block);
public:
	Bucket(char* hola,int blockSize);
	Bucket(int ds,int blockSize);
	int getDispersionSize();
	estados insertRecord(Record* newRecord);
	estados deleteRecord(Record* record);
	int searchRecord(string key);
    char* getBlock();
    int getBytes();
	virtual ~Bucket();
    vector<Record*> *getRecords();
    void setRecords(vector<Record*> *records);
    int getBucketSize() const;
    int getFreeBytes();
    int getMaxCharge() const;
    void setBucketSize(int bucketSize);
    void setDispersionSize(int dispersionSize);
    void buildBucketFromBlock(char * block,int blockSize);

};

#endif /* BUCKET_H_ */
